export const setAuthToken = (token) => {
    localStorage.setItem('token', token);
}

export const getAuthToken = () => {
    return localStorage.getItem('token');
}

export const removeAuthToken = () => {
    localStorage.removeItem('token');
}

export const setUserInfo = (user) => {
    localStorage.setItem('user', JSON.stringify(user));
}

export const getUserInfo = () => {
    return JSON.parse(localStorage.getItem('user'));
}

export const removeUserInfo = () => {
    localStorage.removeItem('user');
}

export const logout = () => {
    removeAuthToken();
    removeUserInfo();
}

